﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
using FSS.Core.Util;
using FSS.Core.Controls;
using FSS.BLL.Services;
using FSS.BLL.Entities;

namespace SalesManagement.Modules.Purchase
{
    public partial class VoucherOutReturnDetail : BasePage
    {
        public VoucherOutReturnDetail()
            : base(SCREENS.VOUCHERINRETURNDETAIL)
        {

        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack || !X.IsAjaxRequest)
                BindingProvider();
        }
        public void ProviderChange(object sender, DirectEventArgs e)
        {
            Session["ProviderID"] = cbProvider.SelectedItem.Value;
        }
        [DirectMethod]
        public void getDetailVoucherIn(Int64 VoucherInID)
        {
            /*
            VoucherDetailService voucherDetailS = VoucherDetailService.GetInstance();
            IList<VoucherDetailEntity> Resul = voucherDetailS.GetAllDetailForReturn(VoucherInID);
            stVoucherDetailIn.DataSource = Resul;
            stVoucherDetailIn.DataBind();
             * */
        }
        #region binding data
        /// <summary>
        /// Gan nha cung cap
        /// </summary>
        private void BindingProvider()
        {
            ObjectService service = ObjectService.GetInstance();
            IList<ObjectEntity> lstAllProvider = service.GetAllProvider();
            if (lstAllProvider == null) return;
            stProvider.DataSource = lstAllProvider;
            stProvider.DataBind();
            if (lstAllProvider.Count > 0)
                cbProvider.SelectedIndex = 0;
        }
        #endregion

    }
}
